import java.util.Scanner;

public class XunHuan {
    public static void main(String[] args) {
        int num=(int)(Math.random()*100+1);
        System.out.println("随机数字是:"+num);
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入一个数字:");
        int input=scanner.nextInt();
        while(true){
            if(num==input){
                System.out.println("恭喜猜对了");
                break;
            }
            else if(num>input){
                System.out.println("猜小了");
            }else{
                System.out.println("猜大了");
            }
            System.out.println("请重新输入一个数字:");
            input=scanner.nextInt();
        }

    }

}

